package com.readbook.action;


import com.readbook.service.StaticlogService;
import com.readbook.util.ExportWord;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/staticlog")
public class staticlog {
    @Resource
    private StaticlogService staticlogService;

    /**
     * @author 牟明艳
     * @comments 成长记录
     * @time 2019年9月25日21:36:12
     */
    @RequestMapping("getczjl.html")
    @ResponseBody
    public Map<String, Object> getczjl(HttpServletRequest request, HttpServletResponse response) {
        String usid = "";
        if (request.getParameter("usid") != null) {
            usid = request.getParameter("usid").toString().trim();
        }

        Map<String, Object> gmap = new HashMap<String, Object>();
        gmap.put("usid", usid);
        Map<String, Object> rmap = staticlogService.getczjl(gmap);
        return rmap;
    }


    /**
     * @author 牟明艳
     * @comments 查询我的阅读记录
     * @time 2019年9月26日16:31:56
     */
    @RequestMapping("getMyAllReadLog.html")
    @ResponseBody
    public List<Map<String, Object>> getMyAllReadLog(HttpServletRequest request, HttpServletResponse response) {
        String usid = "";
        if (request.getParameter("usid") != null) {
            usid = request.getParameter("usid").toString().trim();
        }

        Map<String, Object> gmap = new HashMap<String, Object>();
        gmap.put("usid", usid);
        List<Map<String, Object>> listmap = staticlogService.getMyAllReadLog(gmap);
        return listmap;
    }


    /**
     * @author 牟明艳
     * @comments 查询我的诗词作业记录
     * @time 2019年9月26日16:31:56
     */
    @RequestMapping("getMyAllPoetryreadlog.html")
    @ResponseBody
    public List<Map<String, Object>> getMyAllPoetryreadlog(HttpServletRequest request, HttpServletResponse response) {
        String usid = "";
        if (request.getParameter("usid") != null) {
            usid = request.getParameter("usid").toString().trim();
        }

        Map<String, Object> gmap = new HashMap<String, Object>();
        gmap.put("usid", usid);
        List<Map<String, Object>> listmap = staticlogService.getMyAllPoetryreadlog(gmap);
        return listmap;
    }


    /**
     * @author 牟明艳
     * @comments 查询学生积分统计
     * @time 2019年10月10日15:55:05
     */
    @RequestMapping("studentjf_static.html")
    @ResponseBody
    public Map<String, Object> studentjf_static(HttpServletRequest request, HttpServletResponse response) {
        String nj = "";
        if (request.getParameter("nj") != null) {
            nj = request.getParameter("nj").toString().trim();
        }

        String bj = "";
        if (request.getParameter("bj") != null) {
            bj = request.getParameter("bj").toString().trim();
        }

        String sname = "";
        if (request.getParameter("sname") != null) {
            sname = request.getParameter("sname").toString().trim();
        }
        String order = "";
        if (request.getParameter("order") != null) {
            order = request.getParameter("order").toString().trim();
        }

        int page = 1;
        if (request.getParameter("_PAGE_NO_") != null) {
            page = Integer.parseInt(request.getParameter("_PAGE_NO_").toString().trim());
        }

        int size = 10;
        if (request.getParameter("_PAGE_SIZE_") != null) {
            size = Integer.parseInt(request.getParameter("_PAGE_SIZE_").toString().trim());
        }
        int start = page * size - size + 1;
        int end = page * size;


        Map<String, Object> gmap = new HashMap<String, Object>();
        gmap.put("nj", nj);
        gmap.put("bj", bj);
        gmap.put("sname", sname);
        gmap.put("order", order);
        gmap.put("start", start);
        gmap.put("end", end);

        List<Map<String, Object>> list1 = staticlogService.studentjf_static_page(gmap);
        int totals = staticlogService.studentjf_static_count(gmap);
        Map<String, Object> rmap = new HashMap<String, Object>();
        rmap.put("data", list1);
        rmap.put("totalItems", totals);
        return rmap;
    }


    /**
     * @author 牟明艳
     * @comments 根据学生ID查询积分来源
     * @time 2019年10月10日22:33:20
     */
    @RequestMapping("jfjlByusid.html")
    @ResponseBody
    public Map<String, Object> jfjlByusid(HttpServletRequest request, HttpServletResponse response) {

        String usid = "";
        if (request.getParameter("usid") != null) {
            usid = request.getParameter("usid").toString().trim();
        }
        String order = "";
        if (request.getParameter("order") != null) {
            order = request.getParameter("order").toString().trim();
        }

        int page = 1;
        if (request.getParameter("_PAGE_NO_") != null) {
            page = Integer.parseInt(request.getParameter("_PAGE_NO_").toString().trim());
        }

        int size = 10;
        if (request.getParameter("_PAGE_SIZE_") != null) {
            size = Integer.parseInt(request.getParameter("_PAGE_SIZE_").toString().trim());
        }
        int start = page * size - size + 1;
        int end = page * size;


        Map<String, Object> gmap = new HashMap<String, Object>();
        gmap.put("usid", usid);
        gmap.put("order", order);
        gmap.put("start", start);
        gmap.put("end", end);

        List<Map<String, Object>> list1 = staticlogService.jfjlByusid_page(gmap);
        int totals = staticlogService.jfjlByusid_count(gmap);
        Map<String, Object> rmap = new HashMap<String, Object>();
        rmap.put("data", list1);
        rmap.put("totalItems", totals);
        return rmap;
    }


    /**
     * @author 牟明艳
     * @comments 分页查询积分兑换记录
     * @time 2019年10月10日23:37:25
     */
    @RequestMapping("jfdhjl_byusid.html")
    @ResponseBody
    public Map<String, Object> jfdhjl_byusid(HttpServletRequest request, HttpServletResponse response) {

        String usid = "";
        if (request.getParameter("usid") != null) {
            usid = request.getParameter("usid").toString().trim();
        }
        String order = "";
        if (request.getParameter("order") != null) {
            order = request.getParameter("order").toString().trim();
        }

        int page = 1;
        if (request.getParameter("_PAGE_NO_") != null) {
            page = Integer.parseInt(request.getParameter("_PAGE_NO_").toString().trim());
        }

        int size = 10;
        if (request.getParameter("_PAGE_SIZE_") != null) {
            size = Integer.parseInt(request.getParameter("_PAGE_SIZE_").toString().trim());
        }
        int start = page * size - size + 1;
        int end = page * size;


        Map<String, Object> gmap = new HashMap<String, Object>();
        gmap.put("usid", usid);
        gmap.put("order", order);
        gmap.put("start", start);
        gmap.put("end", end);

        List<Map<String, Object>> list1 = staticlogService.jfdhjl_byusid_page(gmap);
        int totals = staticlogService.jfdhjl_byusid_count(gmap);
        Map<String, Object> rmap = new HashMap<String, Object>();
        rmap.put("data", list1);
        rmap.put("totalItems", totals);
        return rmap;
    }


    /**
     * @author 牟明艳
     * @comments 分页查询用户的书籍阅读数
     * @time 2019年10月11日10:46:08
     */
    @RequestMapping("readbook_static.html")
    @ResponseBody
    public Map<String, Object> readbook_static(HttpServletRequest request, HttpServletResponse response) {
        String nj = "";
        if (request.getParameter("nj") != null) {
            nj = request.getParameter("nj").toString().trim();
        }

        String bj = "";
        if (request.getParameter("bj") != null) {
            bj = request.getParameter("bj").toString().trim();
        }

        String sname = "";
        if (request.getParameter("sname") != null) {
            sname = request.getParameter("sname").toString().trim();
        }
        String order = "";
        if (request.getParameter("order") != null) {
            order = request.getParameter("order").toString().trim();
        }

        int page = 1;
        if (request.getParameter("_PAGE_NO_") != null) {
            page = Integer.parseInt(request.getParameter("_PAGE_NO_").toString().trim());
        }

        int size = 10;
        if (request.getParameter("_PAGE_SIZE_") != null) {
            size = Integer.parseInt(request.getParameter("_PAGE_SIZE_").toString().trim());
        }
        int start = page * size - size + 1;
        int end = page * size;


        Map<String, Object> gmap = new HashMap<String, Object>();
        gmap.put("nj", nj);
        gmap.put("bj", bj);
        gmap.put("sname", sname);
        gmap.put("order", order);
        gmap.put("start", start);
        gmap.put("end", end);

        List<Map<String, Object>> list1 = staticlogService.readbook_static_page(gmap);
        int totals = staticlogService.readbook_static_count(gmap);
        Map<String, Object> rmap = new HashMap<String, Object>();
        rmap.put("data", list1);
        rmap.put("totalItems", totals);
        return rmap;
    }


    /**
     * @author 牟明艳
     * @comments 根据用户ID分页查询读书完成情况
     * @time 2019年10月11日11:47:17
     */
    @RequestMapping("bookplanByUsid.html")
    @ResponseBody
    public Map<String, Object> bookplanByUsid(HttpServletRequest request, HttpServletResponse response) {
        Map<String, Object> gmap = new HashMap<String, Object>();
        String usid = "";
        if (request.getParameter("usid") != null) {
            usid = request.getParameter("usid").toString().trim();
        }

        String jd = "";
        if (request.getParameter("jd") != null) {
            jd = request.getParameter("jd").toString().trim();
        }
        //未完成的书籍阅读数
        if (jd.equals("0")) {
            gmap.put("wwc", "1");
        }
        //已完成的书籍阅读数
        if (jd.equals("100")) {
            gmap.put("ywc", "1");
        }

        int page = 1;
        if (request.getParameter("_PAGE_NO_") != null) {
            page = Integer.parseInt(request.getParameter("_PAGE_NO_").toString().trim());
        }

        int size = 10;
        if (request.getParameter("_PAGE_SIZE_") != null) {
            size = Integer.parseInt(request.getParameter("_PAGE_SIZE_").toString().trim());
        }
        int start = page * size - size + 1;
        int end = page * size;

        gmap.put("usid", usid);
        gmap.put("start", start);
        gmap.put("end", end);

        List<Map<String, Object>> list1 = staticlogService.bookplanByUsid_page(gmap);
        int totals = staticlogService.bookplanByUsid_count(gmap);
        Map<String, Object> rmap = new HashMap<String, Object>();
        rmap.put("data", list1);
        rmap.put("totalItems", totals);
        return rmap;
    }


    /**
     * @author 牟明艳
     * @comments 分页学生诗词背诵总数
     * @time 2019年10月11日10:46:08
     */
    @RequestMapping("poetrybs_static.html")
    @ResponseBody
    public Map<String, Object> poetrybs_static(HttpServletRequest request, HttpServletResponse response) {
        String nj = "";
        if (request.getParameter("nj") != null) {
            nj = request.getParameter("nj").toString().trim();
        }

        String bj = "";
        if (request.getParameter("bj") != null) {
            bj = request.getParameter("bj").toString().trim();
        }

        String sname = "";
        if (request.getParameter("sname") != null) {
            sname = request.getParameter("sname").toString().trim();
        }
        String order = "";
        if (request.getParameter("order") != null) {
            order = request.getParameter("order").toString().trim();
        }

        int page = 1;
        if (request.getParameter("_PAGE_NO_") != null) {
            page = Integer.parseInt(request.getParameter("_PAGE_NO_").toString().trim());
        }

        int size = 10;
        if (request.getParameter("_PAGE_SIZE_") != null) {
            size = Integer.parseInt(request.getParameter("_PAGE_SIZE_").toString().trim());
        }
        int start = page * size - size + 1;
        int end = page * size;


        Map<String, Object> gmap = new HashMap<String, Object>();
        gmap.put("nj", nj);
        gmap.put("bj", bj);
        gmap.put("sname", sname);
        gmap.put("order", order);
        gmap.put("start", start);
        gmap.put("end", end);

        List<Map<String, Object>> list1 = staticlogService.poetrybs_static_page(gmap);
        int totals = staticlogService.poetrybs_static_count(gmap);
        Map<String, Object> rmap = new HashMap<String, Object>();
        rmap.put("data", list1);
        rmap.put("totalItems", totals);
        return rmap;
    }


    /**
     * @author 牟明艳
     * @comments 根据用户ID分页查询诗词背诵记录
     * @time 2019年10月11日15:03:31
     */
    @RequestMapping("poetryreadLogByUsid.html")
    @ResponseBody
    public Map<String, Object> poetryreadLogByUsid(HttpServletRequest request, HttpServletResponse response) {
        Map<String, Object> gmap = new HashMap<String, Object>();
        String usid = "";
        if (request.getParameter("usid") != null) {
            usid = request.getParameter("usid").toString().trim();
        }

        int page = 1;
        if (request.getParameter("_PAGE_NO_") != null) {
            page = Integer.parseInt(request.getParameter("_PAGE_NO_").toString().trim());
        }

        int size = 10;
        if (request.getParameter("_PAGE_SIZE_") != null) {
            size = Integer.parseInt(request.getParameter("_PAGE_SIZE_").toString().trim());
        }
        int start = page * size - size + 1;
        int end = page * size;

        gmap.put("usid", usid);
        gmap.put("start", start);
        gmap.put("end", end);

        List<Map<String, Object>> list1 = staticlogService.poetryreadLogByUsid_page(gmap);
        int totals = staticlogService.poetryreadLogByUsid_count(gmap);
        Map<String, Object> rmap = new HashMap<String, Object>();
        rmap.put("data", list1);
        rmap.put("totalItems", totals);
        return rmap;
    }


    /**
     * @author 牟明艳
     * @comments 分页查询书籍阅读情况
     * @time 2019年10月11日15:03:31
     */
    @RequestMapping("bookplan_static.html")
    @ResponseBody
    public Map<String, Object> bookplan_static(HttpServletRequest request, HttpServletResponse response) {
        String pid = "";
        if (request.getParameter("pid") != null) {
            pid = request.getParameter("pid").toString().trim();
        }

        String classid = "";
        if (request.getParameter("classid") != null) {
            classid = request.getParameter("classid").toString().trim();
        }

        String bookname = "";
        if (request.getParameter("bookname") != null) {
            bookname = request.getParameter("bookname").toString().trim();
        }


        String author = "";
        if (request.getParameter("author") != null) {
            author = request.getParameter("author").toString().trim();
        }

        String nj = "";
        if (request.getParameter("nj") != null) {
            nj = request.getParameter("nj").toString().trim();
        }

        String bj = "";
        if (request.getParameter("bj") != null) {
            bj = request.getParameter("bj").toString().trim();
        }

        String order = "";
        if (request.getParameter("order") != null) {
            order = request.getParameter("order").toString().trim();
        }
        int page = 1;
        if (request.getParameter("_PAGE_NO_") != null) {
            page = Integer.parseInt(request.getParameter("_PAGE_NO_").toString().trim());
        }

        int size = 10;
        if (request.getParameter("_PAGE_SIZE_") != null) {
            size = Integer.parseInt(request.getParameter("_PAGE_SIZE_").toString().trim());
        }
        int start = page * size - size + 1;
        int end = page * size;

        Map<String, Object> gmap = new HashMap<String, Object>();
        gmap.put("pid", pid);
        gmap.put("classid", classid);
        gmap.put("bookname", bookname);
        gmap.put("author", author);
        gmap.put("nj", nj);
        gmap.put("bj", bj);
        gmap.put("tjly", "0");
        gmap.put("order", order);
        gmap.put("start", start);
        gmap.put("end", end);
        List<Map<String, Object>> list1 = staticlogService.bookplan_static_page(gmap);
        int totals = staticlogService.bookplan_static_count(gmap);
        Map<String, Object> rmap = new HashMap<String, Object>();
        rmap.put("data", list1);
        rmap.put("totalItems", totals);
        return rmap;
    }


    /**
     * @author 牟明艳
     * @comments 根据书籍ID查询读书人员
     * @time 2019年10月11日15:03:31
     */
    @RequestMapping("readBookPerson_static.html")
    @ResponseBody
    public Map<String, Object> readBookPerson_static(HttpServletRequest request, HttpServletResponse response) {
        Map<String, Object> gmap = new HashMap<String, Object>();
        String nj = "";
        if (request.getParameter("nj") != null) {
            nj = request.getParameter("nj").toString().trim();
        }

        String bj = "";
        if (request.getParameter("bj") != null) {
            bj = request.getParameter("bj").toString().trim();
        }

        String sname = "";
        if (request.getParameter("sname") != null) {
            sname = request.getParameter("sname").toString().trim();
        }

        String bid = "";
        if (request.getParameter("bid") != null) {
            bid = request.getParameter("bid").toString().trim();
        }

        String jd = "";
        if (request.getParameter("jd") != null) {
            jd = request.getParameter("jd").toString().trim();
        }
        //未完成的书籍阅读数
        if (jd.equals("0")) {
            gmap.put("wwc", "1");
        }
        //已完成的书籍阅读数
        if (jd.equals("100")) {
            gmap.put("ywc", "1");
        }

        String order = "";
        if (request.getParameter("order") != null) {
            order = request.getParameter("order").toString().trim();
        }
        int page = 1;
        if (request.getParameter("_PAGE_NO_") != null) {
            page = Integer.parseInt(request.getParameter("_PAGE_NO_").toString().trim());
        }

        int size = 10;
        if (request.getParameter("_PAGE_SIZE_") != null) {
            size = Integer.parseInt(request.getParameter("_PAGE_SIZE_").toString().trim());
        }
        int start = page * size - size + 1;
        int end = page * size;


        gmap.put("nj", nj);
        gmap.put("bj", bj);
        gmap.put("sname", sname);
        gmap.put("bid", bid);
        gmap.put("order", order);
        gmap.put("start", start);
        gmap.put("end", end);
        List<Map<String, Object>> list1 = staticlogService.readBookPerson_static_page(gmap);
        int totals = staticlogService.readBookPerson_static_count(gmap);
        Map<String, Object> rmap = new HashMap<String, Object>();
        rmap.put("data", list1);
        rmap.put("totalItems", totals);
        return rmap;
    }


    /**
     * @author 牟明艳
     * @comments 根据书籍ID查询未加入读书计划的人员
     * @time 2019年10月23日16:01:23
     */
    @RequestMapping("noreadBookPerson_static.html")
    @ResponseBody
    public Map<String, Object> noreadBookPerson_static(HttpServletRequest request, HttpServletResponse response) {
        Map<String, Object> gmap = new HashMap<String, Object>();
        String nj = "";
        if (request.getParameter("nj") != null) {
            nj = request.getParameter("nj").toString().trim();
        }

        String bj = "";
        if (request.getParameter("bj") != null) {
            bj = request.getParameter("bj").toString().trim();
        }

        String sname = "";
        if (request.getParameter("sname") != null) {
            sname = request.getParameter("sname").toString().trim();
        }

        String bid = "";
        if (request.getParameter("bid") != null) {
            bid = request.getParameter("bid").toString().trim();
        }

        String order = "";
        if (request.getParameter("order") != null) {
            order = request.getParameter("order").toString().trim();
        }
        int page = 1;
        if (request.getParameter("_PAGE_NO_") != null) {
            page = Integer.parseInt(request.getParameter("_PAGE_NO_").toString().trim());
        }

        int size = 10;
        if (request.getParameter("_PAGE_SIZE_") != null) {
            size = Integer.parseInt(request.getParameter("_PAGE_SIZE_").toString().trim());
        }
        int start = page * size - size + 1;
        int end = page * size;


        gmap.put("nj", nj);
        gmap.put("bj", bj);
        gmap.put("sname", sname);
        gmap.put("bid", bid);
        gmap.put("order", order);
        gmap.put("start", start);
        gmap.put("end", end);
        List<Map<String, Object>> list1 = staticlogService.noreadBookPerson_static_page(gmap);
        int totals = staticlogService.noreadBookPerson_static_count(gmap);
        Map<String, Object> rmap = new HashMap<String, Object>();
        rmap.put("data", list1);
        rmap.put("totalItems", totals);
        return rmap;
    }


    /**
     * @author 牟明艳
     * @comments 分页查询诗词背诵情况
     * @time 2019年10月12日15:44:40
     */
    @RequestMapping("poetryread_static.html")
    @ResponseBody
    public Map<String, Object> poetryread_static(HttpServletRequest request, HttpServletResponse response) {
        String pname = "";
        if (request.getParameter("pname") != null) {
            pname = request.getParameter("pname").toString().trim();
        }

        String author = "";
        if (request.getParameter("author") != null) {
            author = request.getParameter("author").toString().trim();
        }

        String nj = "";
        if (request.getParameter("nj") != null) {
            nj = request.getParameter("nj").toString().trim();
        }

        String bj = "";
        if (request.getParameter("bj") != null) {
            bj = request.getParameter("bj").toString().trim();
        }

        String order = "";
        if (request.getParameter("order") != null) {
            order = request.getParameter("order").toString().trim();
        }
        int page = 1;
        if (request.getParameter("_PAGE_NO_") != null) {
            page = Integer.parseInt(request.getParameter("_PAGE_NO_").toString().trim());
        }

        int size = 10;
        if (request.getParameter("_PAGE_SIZE_") != null) {
            size = Integer.parseInt(request.getParameter("_PAGE_SIZE_").toString().trim());
        }
        int start = page * size - size + 1;
        int end = page * size;

        Map<String, Object> gmap = new HashMap<String, Object>();
        gmap.put("pname", pname);
        gmap.put("author", author);
        gmap.put("nj", nj);
        gmap.put("bj", bj);
        gmap.put("order", order);
        gmap.put("start", start);
        gmap.put("end", end);
        List<Map<String, Object>> list1 = staticlogService.poetryread_static_page(gmap);
        int totals = staticlogService.poetryread_static_count(gmap);
        Map<String, Object> rmap = new HashMap<String, Object>();
        rmap.put("data", list1);
        rmap.put("totalItems", totals);
        return rmap;
    }


    /**
     * @author 牟明艳
     * @comments 分页查询诗词背诵人员
     * @time 2019年10月12日16:26:36
     */
    @RequestMapping("poetryreadPerson_static.html")
    @ResponseBody
    public Map<String, Object> poetryreadPerson_static(HttpServletRequest request, HttpServletResponse response) {
        String readid = "";
        if (request.getParameter("readid") != null) {
            readid = request.getParameter("readid").toString().trim();
        }

        String sname = "";
        if (request.getParameter("sname") != null) {
            sname = request.getParameter("sname").toString().trim();
        }

        String nj = "";
        if (request.getParameter("nj") != null) {
            nj = request.getParameter("nj").toString().trim();
        }

        String bj = "";
        if (request.getParameter("bj") != null) {
            bj = request.getParameter("bj").toString().trim();
        }

        String order = "";
        if (request.getParameter("order") != null) {
            order = request.getParameter("order").toString().trim();
        }
        int page = 1;
        if (request.getParameter("_PAGE_NO_") != null) {
            page = Integer.parseInt(request.getParameter("_PAGE_NO_").toString().trim());
        }

        int size = 10;
        if (request.getParameter("_PAGE_SIZE_") != null) {
            size = Integer.parseInt(request.getParameter("_PAGE_SIZE_").toString().trim());
        }
        int start = page * size - size + 1;
        int end = page * size;

        Map<String, Object> gmap = new HashMap<String, Object>();
        gmap.put("readid", readid);
        gmap.put("sname", sname);
        gmap.put("nj", nj);
        gmap.put("bj", bj);
        gmap.put("order", order);
        gmap.put("start", start);
        gmap.put("end", end);
        List<Map<String, Object>> list1 = staticlogService.poetryreadPerson_static_page(gmap);
        int totals = staticlogService.poetryreadPerson_static_count(gmap);
        Map<String, Object> rmap = new HashMap<String, Object>();
        rmap.put("data", list1);
        rmap.put("totalItems", totals);
        return rmap;
    }


    /**
     * @author 牟明艳
     * @comments 分页查询未背诗词的人员
     * @time 2019年10月23日17:00:08
     */
    @RequestMapping("nopoetryreadPerson_static.html")
    @ResponseBody
    public Map<String, Object> nopoetryreadPerson_static(HttpServletRequest request, HttpServletResponse response) {
        String readid = "";
        if (request.getParameter("readid") != null) {
            readid = request.getParameter("readid").toString().trim();
        }

        String sname = "";
        if (request.getParameter("sname") != null) {
            sname = request.getParameter("sname").toString().trim();
        }

        String nj = "";
        if (request.getParameter("nj") != null) {
            nj = request.getParameter("nj").toString().trim();
        }

        String bj = "";
        if (request.getParameter("bj") != null) {
            bj = request.getParameter("bj").toString().trim();
        }

        String order = "";
        if (request.getParameter("order") != null) {
            order = request.getParameter("order").toString().trim();
        }
        int page = 1;
        if (request.getParameter("_PAGE_NO_") != null) {
            page = Integer.parseInt(request.getParameter("_PAGE_NO_").toString().trim());
        }

        int size = 10;
        if (request.getParameter("_PAGE_SIZE_") != null) {
            size = Integer.parseInt(request.getParameter("_PAGE_SIZE_").toString().trim());
        }
        int start = page * size - size + 1;
        int end = page * size;

        Map<String, Object> gmap = new HashMap<String, Object>();
        gmap.put("readid", readid);
        gmap.put("sname", sname);
        gmap.put("nj", nj);
        gmap.put("bj", bj);
        gmap.put("order", order);
        gmap.put("start", start);
        gmap.put("end", end);
        List<Map<String, Object>> list1 = staticlogService.nopoetryreadPerson_static_page(gmap);
        int totals = staticlogService.nopoetryreadPerson_static_count(gmap);
        Map<String, Object> rmap = new HashMap<String, Object>();
        rmap.put("data", list1);
        rmap.put("totalItems", totals);
        return rmap;
    }


    /**
     * @author 牟明艳
     * @comments 学生数据个人中心
     * @time 2019年10月23日21:21:12
     */
    @RequestMapping("studentDataStatic.html")
    @ResponseBody
    public Map<String, Object> studentDataStatic(HttpServletRequest request, HttpServletResponse response) {
        String nj = "";
        if (request.getParameter("nj") != null) {
            nj = request.getParameter("nj").toString().trim();
        }

        String bj = "";
        if (request.getParameter("bj") != null) {
            bj = request.getParameter("bj").toString().trim();
        }

        String sname = "";
        if (request.getParameter("sname") != null) {
            sname = request.getParameter("sname").toString().trim();
        }

        String order = "";
        if (request.getParameter("order") != null) {
            order = request.getParameter("order").toString().trim();
        }

        Map<String, Object> gmap = new HashMap<String, Object>();
        gmap.put("nj", nj);
        gmap.put("bj", bj);
        gmap.put("sname", sname);
        gmap.put("order", order);
        List<Map<String, Object>> list1 = staticlogService.studentDataStatic(gmap);
        Map<String, Object> rmap = new HashMap<String, Object>();
        rmap.put("data", list1);
        return rmap;
    }


    /**
     * @author 牟明艳
     * @comments 学生数据个人中心
     * @time 2019年10月23日21:21:12
     */
    @RequestMapping("getStudentDataInfo.html")
    @ResponseBody
    public List<Map<String, Object>> getStudentDataInfo(HttpServletRequest request, HttpServletResponse response) {
        String usid = "";
        if (request.getParameter("usid") != null) {
            usid = request.getParameter("usid").toString().trim();
        }

        Map<String, Object> gmap = new HashMap<String, Object>();
        gmap.put("usid", usid);
        List<Map<String, Object>> listmap = staticlogService.getStudentDataInfo(gmap);
        return listmap;
    }


    /**
     * @author 牟明艳
     * @comments 学生数据个人中心-诗词
     * @time 2019年10月24日15:05:35
     */
    @RequestMapping("getStudentPoetryDataInfo.html")
    @ResponseBody
    public List<Map<String, Object>> getStudentPoetryDataInfo(HttpServletRequest request, HttpServletResponse response) {
        String usid = "";
        if (request.getParameter("usid") != null) {
            usid = request.getParameter("usid").toString().trim();
        }
        Map<String, Object> gmap = new HashMap<String, Object>();
        gmap.put("usid", usid);
        List<Map<String, Object>> listmap = staticlogService.getStudentPoetryDataInfo(gmap);
        return listmap;
    }


    /**
     * @author 牟明艳
     * @comments 班级数据统计
     * @time 2019年10月25日16:24:40
     */
    @RequestMapping("BjDataStatic.html")
    @ResponseBody
    public Map<String, Object> BjDataStatic(HttpServletRequest request, HttpServletResponse response) {
        String order = "jfnum desc";
        if (request.getParameter("order") != null) {
            order = request.getParameter("order").toString().trim();
        }

        Map<String, Object> gmap = new HashMap<String, Object>();
        Map<String, Object> smap = new HashMap<String, Object>();
        gmap.put("order", order);
        List<Map<String, Object>> list1 = staticlogService.BjDataStatic(gmap);
        smap.put("newstatic", list1);

        List<Map<String, Object>> list2 = staticlogService.NjDataStatic(gmap);
        smap.put("njtatic", list2);
        return smap;
    }


    /**
     * @author 牟明艳
     * @comments 学生数据个人中心导出
     * @time 2019年11月4日14:44:35
     */
    @RequestMapping("exportStudentDataInfo.html")
    public void exportStudentDataInfo(HttpServletRequest request, HttpServletResponse response) throws IOException {
        String usid = "";
        if (request.getParameter("usid") != null) {
            usid = request.getParameter("usid").toString().trim();
        }
        Map<String, Object> gmap = new HashMap<String, Object>();
        gmap.put("usid", usid);
        Map<String, Object> rmap = staticlogService.exportStudentDataInfo(gmap, request, response);
        String fileurl = "readbook.ftl";
        ExportWord.exportMillCertificateWord(request, response, rmap, fileurl);
    }


    /**
     * @author 牟明艳
     * @comments 诗词数据个人中心导出
     * @time 2019年11月4日18:52:42
     */
    @RequestMapping("exportStudentPoetryDataInfo.html")
    public void exportStudentPoetryDataInfo(HttpServletRequest request, HttpServletResponse response) throws IOException {
        String usid = "";
        if (request.getParameter("usid") != null) {
            usid = request.getParameter("usid").toString().trim();
        }
        Map<String, Object> gmap = new HashMap<String, Object>();
        gmap.put("usid", usid);
        Map<String, Object> rmap = staticlogService.exportStudentPoetryDataInfo(gmap, request, response);
        String fileurl = "poetryread.ftl";
        ExportWord.exportMillCertificateWord(request, response, rmap, fileurl);
    }


}
